<?php

class Application_Form_Ajouterformation  extends Twitter_Bootstrap_Form_Horizontal
{
           
    public function init()
    {
    	
    	
    	
    	$decorator=array(
			    			array('ViewHelper', array('tag'   => 'div', "class"=>"controls")),
			    			array('Label' , array(  "class"=>"control-label")),
			    			'Errors',
			    			new Zend_Form_Decorator_HtmlTag(array(
			    					'tag'   => 'div', "class"=>"control-group"
			    			)
			    		)
    	);
    	 
   
    	$translate = Zend_Registry::get('Zend_Translate');
    	$translate->setLocale('fr');
    	
    	
    	$modele= new Zend_Form_Element_Select('model');
    	
    	$modele->addMultiOption("","");
    	$modele->setLabel("Modele : ")
    	->setRequired(true);
    	$modele->addMultiOption("presentiel","Presentiel");
    	$modele->addMultiOption("non presentiel","Non presentiel");
    	$modele->addMultiOption("mixte","Mixte");
    	
    	$lebelle= new Zend_Form_Element_Text('lebelle');
    	$lebelle->setLabel("Libelle ")
    	->setRequired(true);
    	 
    	
    	$nbheur = new Zend_Form_Element_Text('nbheur');
    	$nbheur->setRequired(true) 
    	->setAttrib("class", "input-large");
    	$nbheur->setLabel($translate->_('Nombre d heur par jour').'* : ');
    	
    	$nbjour = new Zend_Form_Element_Text('nbjour');
    	$nbjour->setRequired(true)
    	->setAttrib("class", "input-large");
    	$nbjour->setLabel($translate->_('Nombre de jour de formation ').'* : ');

    	$description = new Zend_Form_Element_Textarea('desc');
    	$description->setRequired(true)
    	->addValidators(array())
    	->setAttrib('COLS', '40')
    	->setAttrib('ROWS', '4')
    	->setAttrib('class','validate[required] text-input')
    	->setAttrib("class", "input-large");
    	$description->setLabel($translate->_('Description ').'* : ');
    	
    	
    	$sendBt = new Zend_Form_Element_Submit('enregistrer');
    	$sendBt->setLabel('Ajouter formation');
    	$sendBt->setAttrib('class', 'btn btn-info');
    	 
    	$annuler = new Zend_Form_Element_Button('Annuler');
    	$annuler->setLabel('Annuler');
    	$annuler->setAttrib('class', 'btn btn-info');
    	
    
    	$modele->setDecorators($decorator);
    	$lebelle->setDecorators($decorator);
    	$nbheur->setDecorators($decorator);
    	$nbjour->setDecorators($decorator);
    	$description->setDecorators($decorator);
    	$sendBt->setDecorators(array('ViewHelper'));
    	$annuler->setDecorators(array('ViewHelper'));
    	
    	$this->addElements(array($modele,$lebelle,$nbheur,$nbjour,$description,$sendBt,$annuler ));
    	
    }
}